package com.yuyou.tas.feedback.mapper;

import com.yuyou.tas.feedback.vo.resp.FeedbackClassStatis;
import com.yuyou.tas.feedback.vo.resp.FeedbackCommentStatis;
import com.yuyou.tas.feedback.vo.resp.FeedbackSituationStatis;
import com.yuyou.tas.feedback.vo.resp.FeedbackStudentStatis;
import com.yuyou.tas.service.api.feedback.dto.FeedbackDetailDTO;
import com.yuyou.tas.service.api.feedback.dto.FeedbackListDTO;
import com.yuyou.tas.service.api.feedback.entity.Feedback;
import com.yuyou.tas.service.api.feedback.vo.resp.FeedbackNameResp;
import com.yuyou.tas.service.api.feedback.vo.resp.StudentFeedBackEdit;
import com.yuyou.tas.util.bean.Pagination;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface FeedbackMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Feedback record);

    Feedback selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Feedback record);

    List<FeedbackListDTO> findFeedbackList(Pagination<FeedbackListDTO> queryPgn);

    int findFeedbackCount(Pagination<FeedbackListDTO> queryPgn);

    Integer getMaxSortByFeedClass(@Param(value = "feedbackClassId") Long feedbackClassId);

    void updateStatusByFeedClass(@Param(value = "feedbackClassId") Long feedbackClassId , @Param(value = "status") Integer status);

    List<StudentFeedBackEdit> findStuDetailByFeedClassId(@Param(value = "feedbackClassId") Long feedbackClassId , @Param(value = "classId") Long classId);

    FeedbackDetailDTO findInfoOfFeedback(Long feedbackId);

    Feedback findFeedbackByStuFeedbackClass(@Param(value = "stuId") Long stuId , @Param(value = "feedbackClassId") Long feedbackClassId);

    List<FeedbackStudentStatis> feedbackOfStudent(@Param(value = "baseSchoolIdList") List<Long> baseSchoolIdList, @Param(value = "baseTrimesterId") Long baseTrimesterId,
                                                  @Param(value = "baseSectionIdList") List<Long> baseSectionIdList, @Param(value = "dataSubjectIdList") List<Long> dataSubjectIdList);

    List<FeedbackClassStatis> feedbackOfClass(@Param(value = "baseSchoolIdList") List<Long> baseSchoolIdList, @Param(value = "baseTrimesterId") Long baseTrimesterId,
                                              @Param(value = "baseSectionIdList") List<Long> baseSectionIdList, @Param(value = "dataSubjectIdList") List<Long> dataSubjectIdList);

    List<FeedbackCommentStatis> feedbackOfComment(@Param(value = "baseSchoolIdList") List<Long> baseSchoolIdList, @Param(value = "baseTrimesterId") Long baseTrimesterId,
                                                         @Param(value = "baseSectionIdList") List<Long> baseSectionIdList, @Param(value = "dataSubjectIdList") List<Long> dataSubjectIdList);

    List<FeedbackSituationStatis> feedbackOfSituation(@Param(value = "baseSchoolIdList") List<Long> baseSchoolIdList, @Param(value = "baseTrimesterId") Long baseTrimesterId,
                                                      @Param(value = "baseSectionIdList") List<Long> baseSectionIdList, @Param(value = "dataSubjectIdList") List<Long> dataSubjectIdList);

    FeedbackNameResp getFeedbackName(@Param(value = "id") Long id);
}